package com.zcsy.commons.upload;

import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @Title: AliyunOssConfig.java
 * @Package： com.zcsy.commons.upload 
 * @Description: 读取oss配置文件信息
 *
 * @author caiyinli 13277030520@163.com
 * @Copyright: 2015 武汉中财数元信息技术有限公司 All rights reserved.
 * @date 2016年5月4日
 * @version 1.0
 * @see JDK1.7.0_75
 * @since
 */

public class AliyunOssConfig {   
		public static String ACCESS_ID = "";  
		public static String ACCESS_KEY = "";  
		public static String OSS_ENDPOINT = "";  
		public static String bucketName = "";   
		static Log log = LogFactory.getLog(AliyunOssConfig.class);    
		public static void load() {    
			log.info("oss配置加载开始  ....");   
			Properties prop = new Properties();   
			try {     
				prop.load(AliyunOssConfig.class.getResourceAsStream("/config/aliyunoss.properties"));    
				ACCESS_ID = prop.getProperty("ACCESS_ID");    
				System.out.println(ACCESS_ID);
				ACCESS_KEY = prop.getProperty("ACCESS_KEY"); 
	
				OSS_ENDPOINT = prop.getProperty(OSS_ENDPOINT);   
				bucketName = prop.getProperty("bucketName");   
			} catch (Exception e) {     
				log.error("oss配置加载失败");   
			} 
		}
		public static String getACCESS_ID() {
			return ACCESS_ID;
		}
		public static void setACCESS_ID(String aCCESS_ID) {
			ACCESS_ID = aCCESS_ID;
		}
		public static String getACCESS_KEY() {
			return ACCESS_KEY;
		}
		public static void setACCESS_KEY(String aCCESS_KEY) {
			ACCESS_KEY = aCCESS_KEY;
		}
		public static String getOSS_ENDPOINT() {
			return OSS_ENDPOINT;
		}
		public static void setOSS_ENDPOINT(String oSS_ENDPOINT) {
			OSS_ENDPOINT = oSS_ENDPOINT;
		}
		public static String getBucketName() {
			return bucketName;
		}
		public static void setBucketName(String bucketName) {
			AliyunOssConfig.bucketName = bucketName;
		}
		
		
}

